﻿using CfgTable;

namespace IQIGame.Onigao.GamePlay
{
    public static class APIMall
    {
        /// <summary>
        /// 获取页签文本内容
        /// </summary>
        /// <param name="normalMallType"></param>
        /// <returns>页面名</returns>
        public static string GetMallMainTypeTabName(MallOriginalType originalType, int mainType)
        {
            return originalType switch
            {
                MallOriginalType.Mall => GetNormalMallMainTypeTabName(mainType),
                _ => ""
            };
        }

        private static string GetNormalMallMainTypeTabName(int mainType)
        {
            MallNormalMainType type = (MallNormalMainType)mainType;
            return type switch
            {
                MallNormalMainType.MallActive => "推荐",
                MallNormalMainType.MonthCard => "月卡",
                MallNormalMainType.Recharge => "充值",
                MallNormalMainType.MallNormal => "商城",
                _ => ""
            };
        }

        /// <summary>
        /// 获取商品标签文本
        /// </summary>
        /// <param name="mallItemTag"></param>
        /// <returns>页面名</returns>
        public static string GetMallItemTagName(MallItemTag mallItemTag)
        {
            return mallItemTag switch
            {
                MallItemTag.Discount => "折扣",
                MallItemTag.Hot => "畅销",
                MallItemTag.New => "新品",
                MallItemTag.TimeLimit => "限时",
                _ => ""
            };
        }

        public static string GetStrMallLimitBuyCount(MallLimitBuyCountType limitType, int limitCount, int count)
        {
            return limitType switch
            {
                MallLimitBuyCountType.Day => string.Format("每日限购{0}/{1}", count, limitCount),
                MallLimitBuyCountType.Life => string.Format("限购{0}/{1}", count, limitCount),
                MallLimitBuyCountType.Weekly => string.Format("每周限购{0}/{1}", count, limitCount),
                MallLimitBuyCountType.Month => string.Format("每月限购{0}/{1}", count, limitCount),
                _ => ""
            };
        }


        public static string Free = "免费";

        public static string MonthCardUnLockDesc = "月卡已激活，剩余时间{0}天";

        public static string RechargeTitle = "￥";

        public static string ItemNumStyle = "x{0}";

    }
}
